package 筛质数;

import java.util.*;

public class Main {
    static int N = 1000010, cnt;
    static int[] pr = new int[N];
    static boolean[] st = new boolean[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for (int i = 2; i <= n; i++) {
            if (!st[i]) {
                pr[cnt++] = i;
            }
            for (int j = 0; pr[j] <= n / i; j++) {
                st[pr[j] * i] = true;
                if(i%pr[j]==0){
                    break;
                }
            }
        }
        System.out.println(cnt);
    }
}
